<template>
  <div class="account" :style="{minHeight:$store.state.minHeight+'rem'}">
    <header>
      <div class="top">
        <img src="../../../static/img/zuojiantou.png" alt="" @click="back">
        <span>账户明细</span>
      </div>
      <div class="tab">
        <div v-for="(x,y) in tab" class="tab_box" @click="isTab(y)">
          <p :class="present == y?'':'selected'">{{x.text}}</p>
          <transition name="el-zoom-in-center">
            <p v-show="present == y"></p>
          </transition>
        </div>
      </div>
    </header>
    <div class="accountList">
      <router-link class="list" tag="div" to="/views/Business/accountDetail">
        <div class="left">
          <div class="name">外卖订单入账</div>
          <div class="time">2020-05-22 18:90</div>
        </div>
        <div class="right">+0.80</div>
      </router-link>
      <div class="list">
        <div class="left">
          <div class="name">外卖订单入账</div>
          <div class="time">2020-05-22 18:90</div>
        </div>
        <div class="right">+0.80</div>
      </div>
      <div class="list">
        <div class="left">
          <div class="name">提现</div>
          <div class="time">2020-05-22 18:90</div>
        </div>
        <div class="right red">-3.00</div>
      </div>
    </div>
  </div>
</template>

<script>
  import all from "../../components/ClientComponents/assemble/all";

  export default {
    name: "account",
    components:{
      all
    },
    data() {
      return {
        tab: [
          {text: '全部'},
          {text: '已入账'},
          {text: '提现'}
        ],
        present: 0,
      }
    },
    methods: {
      back() {
        this.$router.back();
      },
      isTab(index){
        this.present = index;
      },
    }
  }
</script>

<style scoped>
  .account{
    background: #F5F5F5;
    padding-top: .96rem;
  }

  header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 88;
    flex-flow: row;
    box-sizing: border-box;
  }
  header .top{
    height: .5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(170deg,rgba(251,68,72,1) 0%,rgba(254,111,77,1) 100%);
    padding: 0 .1rem;
  }
  header > div > img {
    width: .11rem;
    height: .18rem;
  }

  header > div > span {
    font-size: .18rem;
    font-weight: 500;
    color: #ffffff;
    flex-grow: 1;
    text-align: center;
  }

  /* 订单分类部分 */
  .tab {
    width: 100%;
    height: 100%;
    max-height: .45rem;
    display: flex;
    flex-flow: row;
    justify-content: space-between;
    /*align-items: center;*/
    background-color: #ffffff;
  }

  .tab_box {
    height: 100%;
    width: calc(100% / 3);
    max-height: .55rem;
    display: flex;
    flex-flow: column;
    justify-content: space-between;
    /*align-items: center;*/
    box-sizing: border-box;
    text-align: center;
  }

  .tab_box > p:nth-child(1) {
    color: #FB4448;
    font-size: .16rem;
    line-height: .16rem;
    padding: .15rem 0 .13rem;
  }

  .tab_box > p:nth-child(2) {
    width: 100%;
    height: .02rem;
    background-color: #FF300D;
    border-radius: .01rem;
  }

  .el-loading-spinner {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    min-height: 5rem;
  }

  .selected {
    color: #333333 !important;
    font-size: .16rem !important;
  }


  .accountList{
    margin-top: .1rem;
    background: #ffffff;
  }

  .accountList .list{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .12rem .15rem;
    border-bottom: 1px solid #F0F0F0;
  }
  .accountList .list .name{
    font-size: .13rem;
    color: #333333;
    margin-bottom: .03rem;
  }
  .accountList .list .time{
    font-size: .11rem;
    color: #999999;
  }
  .accountList .list .right{
    font-size: .15rem;
    color: #565656;
  }
  .accountList .list .right.red{
    color: #FB4B4B;
  }


</style>
